<%@page isELIgnored="false" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>

<div>
 <tiles:insertDefinition name="public.menus.students"/>
 <table cellspacing="0" cellpadding="0" class="table_list">
  <tbody>  
	<c:forEach items="${students}" var="student">		
		<tr><td>
			<div class="listingTitle">${student.displayName} - <i>${student.courseName}</i></div>
			<div>
				<div style="float:left;">
				<c:choose>
					<c:when test="${not empty student.imageKey}">
						<div style="padding-right: 10px; padding-bottom: 10px"><img src="/serve.do?key=${student.imageKey}&width=125&height=125" /></div>
					</c:when>
					<c:otherwise>
						<img src="/img/no_image.gif" width="128" height="128"/>					
					</c:otherwise>
				</c:choose>
				</div>
				<p>${student.bio}</p>				
			</div>
		</td></tr>		   	
   	</c:forEach>	   	
  </tbody></table>
</div>
<div class="public_paging">
      <ul>
      <c:forEach begin="1" end="${pages}" step="1" var="num">
      	<c:choose>
      		<c:when test="${num == page}">
      			<li><a class="current" href="/students/enrolled.do?page=${num}">${num}</a></li>
      		</c:when>
      		<c:otherwise>
      			<li><a href="/students/enrolled.do?page=${num}">${num}</a></li>
      		</c:otherwise>
      	</c:choose>
      </c:forEach>
      <c:choose>
      	<c:when test="${page lt pages}">
        	<li><a class="next" href="/students/enrolled.do?page=${page + 1}">NEXT</a></li>
      	</c:when>
      	<c:otherwise>
      	</c:otherwise>
      </c:choose>
      </ul>
</div>